from django.db import models


# Create your models here.
class Author(models.Model):
    name = models.CharField(max_length=255)
    age = models.CharField(max_length=255)
    sex = models.CharField(max_length=255)
    icon = models.CharField(max_length=255)
    hobby = models.CharField(max_length=255)
    content = models.CharField(max_length=255)

    class Meta:
        db_table = "Author"


class Book(models.Model):
    btype=models.CharField(max_length=255)
    book = models.CharField(max_length=255)
    author = models.ForeignKey(Author, on_delete=models.CASCADE)
    content = models.CharField(max_length=255)
    time = models.CharField(max_length=255)

    class Meta:
        db_table = "Book"
